public class hw2 {
    //求 N 的阶乘
    public static void main(String[] args) {
        int n = 5;
        System.out.println(n+"的阶乘为"+fac(n));
    }
    public static int fac(int n) {
        int f = 1;
        for (int i = 1; i <= n ; i++) {
            f *= i;
        }
        return f;
    }

}
